package com.java.lesson.c;

public class hashset2 {
    public static void main(String[] args) {
        //相同对象哈希值相同
        System.out.println("张三".hashCode());//774889
        System.out.println("张三".hashCode());//774889

        //不同对象哈希值不同
        System.out.println(new Object().hashCode());
        System.out.println(new Object().hashCode());

        //不同的对象的哈希值也有可能相同，例外情况
        System.out.println("辂鹅".hashCode());//1179395
        System.out.println("较鸦".hashCode());//1179395
        System.out.println("辄鸇".hashCode());//1179395
        System.out.println("辅鷨".hashCode());//1179395
    }
}
